package com.shycloud.mido.music.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shycloud.mido.music.domain.MisMusic;
import com.shycloud.mido.music.domain.MisUserMusic;
import com.shycloud.mido.music.vo.CoursewareDetailVO;
import com.shycloud.mido.music.vo.MisMusicVO;
import org.apache.ibatis.annotations.Param;

public interface MisUserMusicMapper extends BaseMapper<MisUserMusic> {

	/**
	 * 获取【我喜欢】列表
	 *
	 * @param page
	 * @param userId
	 * @param type
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.shycloud.mido.music.domain.MisMusic>
	 * @author nianhua.jiang
	 * @date 2020/6/13 15:00
	 */
	IPage<MisMusicVO> getUserMusic(@Param("page") Page page, @Param("userId") String userId, @Param("type") String type);

	int getDownloadMp3Count(@Param("memberId") String memberId);

	int updateDownloadMp3Count(@Param("downloadMp3CountAfter") int downloadMp3CountAfter, @Param("memberId") String memberId);

	Integer getUserMusicCount(@Param("memberId") String memberId, @Param("type") int type);

	@SqlParser(filter = true)
	IPage<CoursewareDetailVO> getUserMusicForCourseWare(@Param("page") Page page, @Param("memberId") String memberId, @Param("teacherId") String teacherId, @Param("studentId") String studentId);
}